home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 June: Reference Library / Dev.CD Jun 95 / Dev.CD Jun 95.toast / What's New? / New System Software Extensions / QuickDraw 3D ß / Programming / Interfaces / QD3DGroup.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-04  |  8.1 KB  |  264 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **                                                                             **
  4.  **     Module:        QD3DGroup.h                                                 **
  5.  **                                                                             **
  6.  **                                                                             **
  7.  **     Purpose:                                                             **
  8.  **                                                                             **
  9.  **                                                                             **
  10.  **     Copyright (C) 1992-1995 Apple Computer, Inc.  All rights reserved.     **
  11.  **                                                                             **
  12.  **                                                                             **
  13.  *****************************************************************************/
  14. #ifndef QD3DGroup_h
  15. #define QD3DGroup_h
  16.  
  17. #if PRAGMA_ONCE
  18.     #pragma once
  19. #endif
  20.  
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif /*  __cplusplus  */
  25.  
  26.  
  27. /******************************************************************************
  28.  **                                                                             **
  29.  **                            Group Typedefs                                     **
  30.  **                                                                             **
  31.  *****************************************************************************/
  32.  
  33. /*
  34.  * These flags affect how a group is traversed
  35.  * They apply to when a group is "drawn", "picked" or "bounded"
  36.  */
  37. typedef enum TQ3DisplayGroupStateMasks {
  38.     kQ3DisplayGroupStateNone                    = 0,
  39.     kQ3DisplayGroupStateMaskIsDrawn                = 1 << 0,
  40.     kQ3DisplayGroupStateMaskIsInline            = 1 << 1,
  41.     kQ3DisplayGroupStateMaskUseBoundingBox        = 1 << 2,
  42.     kQ3DisplayGroupStateMaskUseBoundingSphere    = 1 << 3,
  43.     kQ3DisplayGroupStateMaskIsPicked            = 1 << 4
  44. } TQ3DisplayGroupStateMasks;
  45.  
  46. typedef unsigned long TQ3DisplayGroupState;
  47.  
  48. /******************************************************************************
  49.  **                                                                             **
  50.  **                    Group Routines (apply to all groups)                     **
  51.  **                                                                             **
  52.  *****************************************************************************/
  53.  
  54. EXPORT TQ3GroupObject Q3Group_New(        /* May contain any shared object */
  55.     void);
  56.     
  57. EXPORT TQ3ObjectType Q3Group_GetType(
  58.     TQ3GroupObject            group);
  59.  
  60. EXPORT TQ3GroupPosition Q3Group_AddObject(
  61.     TQ3GroupObject            group,
  62.     TQ3Object                object);
  63.     
  64. EXPORT TQ3GroupPosition Q3Group_AddObjectBefore(
  65.     TQ3GroupObject            group,
  66.     TQ3GroupPosition        position,
  67.     TQ3Object                object);
  68.  
  69. EXPORT TQ3GroupPosition Q3Group_AddObjectAfter(
  70.     TQ3GroupObject            group,
  71.     TQ3GroupPosition        position,
  72.     TQ3Object                object);
  73.  
  74. EXPORT TQ3Status Q3Group_GetPositionObject(
  75.     TQ3GroupObject            group,
  76.     TQ3GroupPosition        position,    
  77.     TQ3Object                *object);        
  78.  
  79. EXPORT TQ3Status Q3Group_SetPositionObject(
  80.     TQ3GroupObject            group,
  81.     TQ3GroupPosition        position,
  82.     TQ3Object                object);
  83.  
  84. EXPORT TQ3Object Q3Group_RemovePosition(
  85.     TQ3GroupObject            group,
  86.     TQ3GroupPosition        position);
  87.  
  88. EXPORT TQ3Status Q3Group_GetFirstPosition(        
  89.     TQ3GroupObject            group,
  90.     TQ3GroupPosition        *position);
  91.  
  92. EXPORT TQ3Status Q3Group_GetLastPosition(        
  93.     TQ3GroupObject            group,
  94.     TQ3GroupPosition        *position);
  95.  
  96. EXPORT TQ3Status Q3Group_GetNextPosition(        
  97.     TQ3GroupObject            group,
  98.     TQ3GroupPosition        *position);
  99.  
  100. EXPORT TQ3Status Q3Group_GetPreviousPosition(        
  101.     TQ3GroupObject            group,
  102.     TQ3GroupPosition        *position);
  103.  
  104. EXPORT TQ3Status Q3Group_CountObjects(
  105.     TQ3GroupObject            group,
  106.     unsigned long            *nObjects);
  107.  
  108. EXPORT TQ3Status Q3Group_EmptyObjects(
  109.     TQ3GroupObject            group);
  110.     
  111. /*
  112.  *     Typed Access
  113.  */
  114. EXPORT TQ3Status Q3Group_GetFirstPositionOfType(        
  115.     TQ3GroupObject            group,
  116.     TQ3ObjectType            isType,
  117.     TQ3GroupPosition        *position);
  118.  
  119. EXPORT TQ3Status Q3Group_GetLastPositionOfType(        
  120.     TQ3GroupObject            group,
  121.     TQ3ObjectType            isType,
  122.     TQ3GroupPosition        *position);
  123.  
  124. EXPORT TQ3Status Q3Group_GetNextPositionOfType(        
  125.     TQ3GroupObject            group,
  126.     TQ3ObjectType            isType,
  127.     TQ3GroupPosition        *position);
  128.  
  129. EXPORT TQ3Status Q3Group_GetPreviousPositionOfType(        
  130.     TQ3GroupObject            group,
  131.     TQ3ObjectType            isType,
  132.     TQ3GroupPosition        *position);
  133.  
  134. EXPORT TQ3Status Q3Group_CountObjectsOfType(
  135.     TQ3GroupObject            group,
  136.     TQ3ObjectType            isType,
  137.     unsigned long            *nObjects);
  138.  
  139. EXPORT TQ3Status Q3Group_EmptyObjectsOfType(
  140.     TQ3GroupObject            group,
  141.     TQ3ObjectType            isType);
  142.  
  143. /*
  144.  *    Determine position of objects in a group
  145.  */
  146. EXPORT TQ3Status Q3Group_GetFirstObjectPosition(
  147.     TQ3GroupObject            group,
  148.     TQ3Object                object,
  149.     TQ3GroupPosition        *position);
  150.     
  151. EXPORT TQ3Status Q3Group_GetLastObjectPosition(
  152.     TQ3GroupObject            group,
  153.     TQ3Object                object,
  154.     TQ3GroupPosition        *position);
  155.  
  156. EXPORT TQ3Status Q3Group_GetNextObjectPosition(
  157.     TQ3GroupObject            group,
  158.     TQ3Object                object,
  159.     TQ3GroupPosition        *position);
  160.     
  161. EXPORT TQ3Status Q3Group_GetPreviousObjectPosition(
  162.     TQ3GroupObject            group,
  163.     TQ3Object                object,
  164.     TQ3GroupPosition        *position);
  165.     
  166.  
  167. /******************************************************************************
  168.  **                                                                             **
  169.  **                            Group Subclasses                                 **
  170.  **                                                                             **
  171.  *****************************************************************************/
  172.  
  173. EXPORT TQ3GroupObject Q3LightGroup_New(        /* Must contain only lights */
  174.     void);
  175.  
  176. EXPORT TQ3GroupObject Q3InfoGroup_New(        /* Must contain only strings */
  177.     void);
  178.  
  179. /******************************************************************************
  180.  **                                                                             **
  181.  **                        Display Group Routines                                 **
  182.  **                                                                             **
  183.  *****************************************************************************/
  184.  
  185. EXPORT TQ3GroupObject Q3DisplayGroup_New(    /* May contain only drawables */
  186.     void);
  187.     
  188. EXPORT TQ3ObjectType Q3DisplayGroup_GetType(
  189.     TQ3GroupObject            group);
  190.  
  191. EXPORT TQ3Status Q3DisplayGroup_GetState(
  192.     TQ3GroupObject            group,
  193.     TQ3DisplayGroupState    *state);
  194.     
  195. EXPORT TQ3Status Q3DisplayGroup_SetState(
  196.     TQ3GroupObject            group,
  197.     TQ3DisplayGroupState    state);
  198.  
  199. EXPORT TQ3Status Q3DisplayGroup_Submit(
  200.     TQ3GroupObject            group, 
  201.     TQ3ViewObject            view);
  202.  
  203. /******************************************************************************
  204.  **                                                                             **
  205.  **        Ordered Display Group                                                  **
  206.  **                                                                             **
  207.  **        Ordered display groups keep objects in order by the type of object:     **
  208.  **                                                                             **
  209.  **        1    kQ3ShapeTypeTransform                                             **
  210.  **        2    kQ3ShapeTypeStyle                                                  **
  211.  **        3    kQ3SetTypeAttribute                                                  **
  212.  **        4    kQ3ShapeTypeShader                                                  **
  213.  **        5    kQ3ShapeTypeCamera                                                  **
  214.  **        6    kQ3ShapeTypeLight                                                  **
  215.  **        7    kQ3ShapeTypeGeometry                                             **
  216.  **        8    kQ3ShapeTypeGroup                                                 **            
  217.  **        9    kQ3SharedTypeUnknown                                             **
  218.  **                                                                             **
  219.  **        Within a type, you are responsible for keeping things in order.         **
  220.  **                                                                             **
  221.  **        You may access and/or manipulate the group using the above types      **
  222.  **        (fast), or you may use any parent or leaf class types (slower).         **
  223.  **                                                                             **
  224.  **        Additional types will be added as functionality grows.                 **
  225.  **                                                                             **
  226.  **        The group calls which access by type are much faster for ordered     ** 
  227.  **        display group for the types above.                                     **
  228.  **                                                                             **
  229.  **        N.B. In QuickDraw 3D 1.0 Lights and Cameras are a no-op when drawn.     **
  230.  **                                                                             **
  231.  *****************************************************************************/
  232.  
  233. EXPORT TQ3GroupObject Q3OrderedDisplayGroup_New(
  234.     void);
  235.         
  236. /******************************************************************************
  237.  **                                                                             **
  238.  **        IO Proxy Display Group                                                  **
  239.  **                                                                             **
  240.  **        IO Proxy display groups are used to place more than one              **
  241.  **        representation of an object in a metafile. For example, if you know     **
  242.  **        another program does not understand NURBPatches but does understand  **
  243.  **        Meshes, you may place a mesh and a NURB Patch in an IO Proxy Group,  **
  244.  **        and the reading program  will select the desired representation.     **
  245.  **                                                                             **
  246.  **        Objects in an IO Proxy Display Group are placed in their preferencial**
  247.  **        order, with the FIRST object being the MOST preferred, the LAST      **
  248.  **        object the least preferred.                                             **
  249.  **                                                                             **
  250.  **        The behavior of an IO Proxy Display Group is that when drawn/picked/ **
  251.  **        bounded, the first object in the group that is not "Unknown" is used,**
  252.  **        and the other objects ignored.                                         **
  253.  **                                                                             **
  254.  *****************************************************************************/
  255.  
  256. EXPORT TQ3GroupObject Q3IOProxyDisplayGroup_New(
  257.     void);
  258.         
  259. #ifdef __cplusplus
  260. }
  261. #endif /*  __cplusplus  */
  262.  
  263. #endif /*  QD3DGroup_h  */
  264.